use std::ptr::null_mut;

use crate::{heap::mi_heap_get_default, internal::mi_heap_is_initialized, types::MiHeap};

pub unsafe fn _mi_malloc_generic(mut heap: *mut MiHeap, size: usize, zero: bool, huge_alignment: usize) -> *mut u8 {
    assert!(!heap.is_null());
    if !mi_heap_is_initialized(heap) {
        heap = mi_heap_get_default();
        if !mi_heap_is_initialized(heap) {
            return null_mut::<u8>();
        }
    }
    assert!(mi_heap_is_initialized(heap));
    null_mut()
}